<?php
// ==============================================================================================
// Licensed under the GNU GPLv3 (LICENSE.txt)
// ==============================================================================================
// @author     WEBO Software (http://www.webogroup.com/)
// @version    1.0.0
// @copyright  Copyright &copy; 2009-2010 WEBO Software. All Rights Reserved
// ==============================================================================================
// no direct access
defined('_JEXEC') or die('Restricted access');

function com_uninstall() {
	include_once(JPATH_SITE . '/components/com_webositeinsight/libs/php/class.database.php');
	$DB = new SiteInSightDB();
	$widgets = $DB->getWidgetsList(false);
	foreach($widgets as $name => $value)
	{
		$DB->deleteWidgetTable($name);
	}
	$DB->dropMainWidgetTable();
	$DB->dropMainTable();
	$database = & JFactory::getDBO();
    $database->setQuery("DELETE FROM `#__plugins` WHERE `element`= 'webositeinsight';");
    $database->query();
    @unlink(JPATH_SITE."/plugins/system/webositeinsight.php");
    @unlink(JPATH_SITE."/plugins/system/webositeinsight.xml");
}

?>
